package com.example.boot.controller;

import com.example.boot.data.GreetingInfo;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
public class GreetController {

    @GetMapping("/greeting")
    @RequestMapping
    public Map<String, Object> find() {
        Map<String, Object> map = new HashMap<>();
        map.put("id", 1);
        map.put("content", "hello world");
        return map;
    }

    @GetMapping("/greeting2")
    public GreetingInfo findGreet() {
        GreetingInfo greetingInfo = new GreetingInfo();
        greetingInfo.setContent("喻涛");
        greetingInfo.setId(9);
        return greetingInfo;
    }

}
